<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="./src/vue.js"></script>
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script>
      const vm = new Vue({
        el: "#app",
        data: {
          picCourse: [], // 图文教程
          recommendCourse: [], // 推荐资讯
        },

        created() {
          // 组件初始加载，会自动调用这个函数。
          // https://m.lanqb.com/api/home/news 推荐资讯接口
          // https://m.lanqb.com/api/home/graphic-tutorials 图文教程
          fetch("https://m.lanqb.com/api/home/graphic-tutorials")
            .then((res) => res.json())
            .then((data) => {
              this.picCourse = data;
            });
        },
      });
    </script>
  </body>
</html>
